package org.icop.matcher;

import java.util.LinkedList;
import java.util.List;

import org.icop.frame.boost.Booster;
import org.icop.frame.boost.MatchCardinalityBooster;
import org.icop.frame.boost.MatchSubsumptionBooster;
import org.icop.frame.eval.GraphEditEvaluator;
import org.icop.frame.search.Searcher;
import org.icop.frame.search.StringMetricLabelSearcher;
import org.icop.frame.search.virtualdoc.StandardVirtualDocForComponentSearcher;
import org.icop.frame.search.virtualdoc.StandardVirtualDocForDistanceSetSearcher;
import org.icop.frame.select.GreedyMappingSimSelector;
import org.jbpt.graph.abs.IDirectedEdge;
import org.jbpt.graph.abs.IDirectedGraph;
import org.jbpt.hypergraph.abs.IVertex;

import uk.ac.shef.wit.simmetrics.similaritymetrics.Levenshtein;

public class DocMatcher<G extends IDirectedGraph<E,V>, E extends IDirectedEdge<V>, V extends IVertex> extends AbstractMatcher<G, E, V> {

	public DocMatcher(){
		List<Searcher<G, E, V>> searchers = new LinkedList<Searcher<G, E, V>>();
		searchers.add(new StringMetricLabelSearcher<G, E, V>(0.5, false, new Levenshtein()));
		searchers.add(new StandardVirtualDocForDistanceSetSearcher<G, E, V>(1, 0.25, false, false, true));
		searchers.add(new StandardVirtualDocForComponentSearcher<G, E, V>(1, 0.5, false, true, true));
		
		List<Booster<G, E, V>> boosters = new LinkedList<Booster<G, E, V>>();
		boosters.add(new MatchCardinalityBooster<G, E, V>());
		boosters.add(new MatchSubsumptionBooster<G, E, V>(0.1));
		
		setSearchers(searchers);
		setBoosters(boosters);
		setEvaluator(new GraphEditEvaluator<G, E, V>(0.5,0.8,0.0,0.0));
		setSelector(new GreedyMappingSimSelector<G, E, V>());
	}
	
}
